﻿using System;

class ShipDamage
{
    static void Main()
    {
        //ship rectangle coordinates
        int shipX1 = int.Parse(Console.ReadLine());
        int shipY1 = int.Parse(Console.ReadLine());
        int shipX2 = int.Parse(Console.ReadLine());
        int shipY2 = int.Parse(Console.ReadLine());

        int left = Math.Min(shipX1, shipX2);
        int right = Math.Max(shipX1, shipX2);
        int top = Math.Max(shipY1, shipY2);
        int bottom = Math.Min(shipY1, shipY2);

        int horizontalLine = int.Parse(Console.ReadLine());

        int damage = 0;
        for (int catapultNumber = 1; catapultNumber <= 3; catapultNumber++)
        {
            int catapultX = int.Parse(Console.ReadLine());
            int catapultY = int.Parse(Console.ReadLine());

            //get hit coordinates
            int hitY = get_hit_coordinates(catapultX, catapultY, horizontalLine);
            //check if hit is within rectangle
            damage += calc_damage(catapultX, hitY, top, right, bottom, left);
        }
        //print damage in percent
        Console.WriteLine("{0}%", damage);
    }

    private static int calc_damage(int catapultX, int hitY, int top, int right, int bottom, int left)
    {
        if (
            (catapultX == left && hitY == top) ||
            (catapultX == left && hitY == bottom) ||
            (catapultX == right && hitY == top) ||
            (catapultX == right && hitY == bottom)
            )
        {
            return 25;
        }
        else if (
                (catapultX == left || catapultX == right) && hitY < top && hitY > bottom ||
                (hitY == top || hitY == bottom) && catapultX < right && catapultX > left
                )
        {
            return 50;
        }
        else if (catapultX > left && catapultX < right &&
            hitY > bottom && hitY < top)
        {
            return 100;
        }
        return 0;
    }

    private static int get_hit_coordinates(int catapultX, int catapultY, int horizontalLine)
    {
        //get offset
        int offset = Math.Abs(horizontalLine - catapultY);
        //get hit position
        if (catapultY < horizontalLine)
        {
            return horizontalLine + offset;
        }
        else if (catapultY > horizontalLine)
        {
            return horizontalLine - offset;
        }
        else
        {
            return horizontalLine;
        }
    }
}